﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TenderSampleApp.Models;
using System.Web.Profile;

namespace TenderSampleApp.Areas.RAC.Controllers
{
    public class RACHomeController : Controller
    {
        //
        // GET: /RAC/Home/

        [Authorize(Roles = "RAC")]
        public ActionResult Index()
        {
            ProfileBase profile = ProfileBase.Create(User.Identity.Name);
            string FirstName = profile.GetPropertyValue("FirstName").ToString();
            if (String.IsNullOrEmpty(FirstName))
                return RedirectToAction("FillRACProfile", "RACProfile", new { area="RAC" });

            DAL dl = new DAL();
            VATListModel listVatModel = dl.GetVatsOfCurrentAuction();
            return View(listVatModel);
        }

        //
        // GET: /RAC/Home/Details/5
 
    }
}
